FROM 121.14.85.107:5000/cnit-centos

MAINTAINER jka

USER root

COPY redis-3.0.7.tar.gz /home/redis-3.0.7.tar.gz
COPY entrypoint.sh /root/entrypoint.sh
RUN  chmod a+x /root/entrypoint.sh

RUN cd /home/ \
        && tar -zxvf redis-3.0.7.tar.gz \
        && cd redis-3.0.7 \
        && cd deps \
        && make hiredis lua \
        && cd jemalloc;./configure;make;cd ../.. \
        && make \
        && make install PREFIX=/usr/local/redis \
	&& mkdir -p /usr/local/redis/etc \
	&& mv redis.conf /usr/local/redis/etc/ \
	&& ln -s /usr/local/redis/bin/redis-server /usr/bin/ \
	&& ln -s /usr/local/redis/bin/redis-cli /usr/bin/ \
	&& ln -s /usr/local/redis/bin/redis-benchmark /usr/bin/ \
	&& ln -s /usr/local/redis/bin/redis-check-aof /usr/bin/ \
	&& ln -s /usr/local/redis/bin/redis-check-dump /usr/bin/ \
	&& ln -s /usr/local/redis/bin/redis-sentinel /usr/bin/ 
    
EXPOSE 6379
	 
#ENTRYPOINT ["redis-server"]  
#CMD ["/usr/local/redis/etc/redis.conf"] 
ENTRYPOINT ["/root/entrypoint.sh"]